﻿@using Known.Razor.Components
@using Microsoft.AspNetCore.Components.Authorization
@using Microsoft.AspNetCore.Components.Routing
@inject Microsoft.JSInterop.IJSRuntime JS
@inherits BaseComponent

<CascadingAuthenticationState>
    <CascadingValue Value="Context">
        <Router AppAssembly="typeof(App).Assembly">
            <Found Context="routeData">
                <AuthorizeRouteView RouteData="@routeData">
                    <Authorizing></Authorizing>
                </AuthorizeRouteView>
            </Found>
            <NotFound>
                <Error Code="404" />
            </NotFound>
        </Router>
        <DialogContainer />
    </CascadingValue>
</CascadingAuthenticationState>

@code {
    protected override void OnInitialized()
    {
        Context = new KRContext
        {
            UI = new UIService(JS)
        };
    }
}